#include "AdminEventManager.h"

using namespace AgoraClient;

AdminEventManager *AdminEventManager::_instance = 0;

AdminEventManager::AdminEventManager()
{
}


AdminEventManager* AdminEventManager::GetAdminEventManager()
{
	if	(AdminEventManager::_instance == 0)
	{
		AdminEventManager::_instance = new AdminEventManager();
	}
	return AdminEventManager::_instance;
}

void	AdminEventManager::SubscribeOnEvent(EventName name, Callback fct, void* data)
{
	this->_callbacks[name].Function = fct;
	this->_callbacks[name].Data = data;
}

	
void	AdminEventManager::LaunchEvent(EventName name, EventArg *e)
{
	if (this->_callbacks.count(name))
	{
		this->_callbacks[name].Function(e, this->_callbacks[name].Data);
	}
}
